package com.gpj.learn.springcloud.common.main.server.controller;

import com.gpj.learn.springcloud.api.CommonServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.UUID;

/**
 * @className ServerController
 * @description ribbon的服务端接口
 * @author GPJ
 * @date 2021/9/26 15:31
 * @version 1.0
 **/
@Slf4j
@RestController
public class ServerController implements CommonServer {
    @Override
    public String info(@PathVariable Integer id) {
        log.info("准备查询[{}]的信息", id);
        return "查询到的信息为:{id:" + id + ", info:" + UUID.randomUUID().toString() + "}";
    }

    @Override
    public void receive(@RequestParam(required = false) String message) {
        log.info("接收到的消息为:{}", message);
    }
}
